﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;

using $safeprojectname$.Service;
using $safeprojectname$.Tools.Wiki;

namespace $safeprojectname$
{
    /// <summary>
    /// Provider (static class) for a Wiki syntax converter
    /// </summary>
    public static class WikiManager
    {
        /// <summary>
        /// Converts the .NET Wiki syntax into the HTML
        /// </summary>
        /// <param name="wikiText"></param>
        /// <returns></returns>
        public static string ConvertToHtml(string wikiText)
        {
            return Current.ConvertToHtml(wikiText) ?? string.Empty;
        }

        #region Provider

        private static IWikiConverter Current
        {
            get { return Instance.Provider; }
        }

        #endregion Provider

        #region lazy instance

        // beforefieldinit off
        // see: http://www.yoda.arachsys.com/csharp/singleton.html
        // see: http://www.yoda.arachsys.com/csharp/beforefieldinit.html
        private static class Instance
        {
            // beforefieldinit
            public static readonly IWikiConverter Provider;

            static Instance()
            {
                Provider = Factory.CreateInstance<IWikiConverter>();
            }
        }

        #endregion lazy instance
    }
}